//
//  ControlModels.swift
//  LEDSMART
//
//  Created by zj on 2022/11/12.
//  Copyright © 2022 LXF. All rights reserved.
//

import Foundation

@objc
@objcMembers
open class CmdSet: NSObject,Codable {
        
    public var name:String = ""
    public var cmdList:[Cmd] = []
}


public extension CmdSet{
    func getCmd(name:String)->Cmd?{
        for cmd in cmdList {
            if cmd.name == name{
                return cmd
            }
        }
        return nil
    }
}

@objc
@objcMembers
open class Cmd: NSObject,Codable {
//    "name":"setRGB",
    public var name:String = ""
//    "title":"9：RGB圆盘"
    public var title:String = ""
//    "remark":"设置RGB值",
    public var remark:String = ""
//    "cmd":"7e ff 05 03 20 f0 f0 ff ef",
    public var cmd:String = ""
    public var cmdEx:[UInt8]? = []
    
    public var paraIndex:[String:Int]? = [:]
//    "paraIndex":{
//        "R":4,
//        "G":5,
//        "B":6,
//    }
}

